package com.css.fxfzdpzs.modules.czt.task;

import com.css.fxfzdpzs.modules.czt.service.CztService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class YsxTask {

    @Autowired
    private CztService cztService;

    /**
     * 二级页面地图
     */
   @Scheduled(cron ="0 0 0 * * ?")  //定时任务一天执行一次 线上用
//    @Scheduled(cron ="0 0/30 * * * ?") //测试用，30分钟一次
    public void getDestructiveState() {
        System.out.println("开始执行了-------------");
        long startTime = System.currentTimeMillis();
        cztService.getDestructiveState();
        long endTime = System.currentTimeMillis();
        log.info("用时:{}", (endTime - startTime) + "ms");
    }
}
